import 'package:flutter/material.dart';

class SetPsd extends StatefulWidget {
  @override
  State<SetPsd> createState() => _SetPsdState();
}

class _SetPsdState extends State<SetPsd> {
  bool showPassword = true;
  bool entenPassword = true;
  bool checked = true;
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('忘记密码'),
        centerTitle: true,
        elevation: 0,
        //leading: Icon(Icons.close),
      ),
      body: Container(
        padding: EdgeInsets.only(top: 30, left: 30, right: 30),
        margin: EdgeInsets.only(top: 30),
        child: Column(
          children: [
            Image.asset(
              'images/login/logo.png',
              width: 103,
              height: 71,
            ),
            Container(
              margin: EdgeInsets.only(top: 30),
              child: Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(right: 10),
                    child: Image.asset(
                      'images/register/nickname.png',
                      width: 20,
                      height: 20,
                    ),
                  ),
                  Expanded(
                    child: TextField(
                      decoration: InputDecoration(
                        border: OutlineInputBorder(borderSide: BorderSide.none),
                        hintText: '请输入手机号',
                      ),
                    ),
                  )
                ],
              ),
            ),
//验证码
            Container(
              child: Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(right: 10),
                    child: Image.asset(
                      'images/login/code.png',
                      width: 20,
                      height: 20,
                    ),
                  ),
                  Container(
                    child: Row(
                      children: [
                        Container(
                          width: 180,
                          child: TextField(
                            decoration: InputDecoration(
                              border: OutlineInputBorder(
                                  borderSide: BorderSide.none),
                              hintText: '请输入验证码',
                            ),
                          ),
                        ),
                        TextButton(
                            onPressed: () {},
                            child: Text(
                              '获取验证码',
                              style: TextStyle(color: Colors.black),
                            ))
                      ],
                    ),
                  ),
                ],
              ),
            ),
//密码
            Container(
              child: Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(right: 10),
                    child: Image.asset(
                      'images/login/password.png',
                      width: 20,
                      height: 20,
                    ),
                  ),
                  Container(
                    child: Row(
                      children: [
                        Container(
                          width: 180,
                          child: TextField(
                            obscureText: showPassword,
                            decoration: InputDecoration(
                              border: OutlineInputBorder(
                                  borderSide: BorderSide.none),
                              hintText: '请输入密码',
                              hintStyle: TextStyle(
                                  color: Color.fromRGBO(153, 153, 153, 1)),
                              suffixIcon: IconButton(
                                color: Colors.grey,
                                icon: Icon(this.showPassword
                                    ? Icons.visibility_off
                                    : Icons.visibility),
                                onPressed: () {
                                  setState(() {
                                    this.showPassword = !this.showPassword;
                                  });
                                },
                              ),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),
            Container(
              child: Row(
                children: [
                  Container(
                    margin: EdgeInsets.only(right: 10),
                    child: Image.asset(
                      'images/login/password.png',
                      width: 20,
                      height: 20,
                    ),
                  ),
                  Container(
                    child: Row(
                      children: [
                        Container(
                          width: 180,
                          child: TextField(
                            obscureText: this.entenPassword,
                            decoration: InputDecoration(
                              border: OutlineInputBorder(
                                  borderSide: BorderSide.none),
                              hintText: '请确认密码',
                              hintStyle: TextStyle(
                                  color: Color.fromRGBO(153, 153, 153, 1)),
                              suffixIcon: IconButton(
                                color: Colors.grey,
                                icon: Icon(this.entenPassword
                                    ? Icons.visibility_off
                                    : Icons.visibility),
                                onPressed: () {
                                  setState(() {
                                    this.entenPassword = !this.entenPassword;
                                  });
                                },
                              ),
                            ),
                          ),
                        ),
                      ],
                    ),
                  ),
                ],
              ),
            ),

            Container(
              margin: EdgeInsets.only(top: 10),
              width: MediaQuery.of(context).size.width,
              height: 48,
              child: ElevatedButton(
                onPressed: () {
                  setState(() {});
                },
                child: Text('确认'),
                // style: ElevatedButton.styleFrom(backgroundColor: Colors.black),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
